import { lhRequest } from "./index"

/**
 * 获取常用就诊人
 * @param {*} loginkey 
 */
export function getPatient(resolve) {
  lhRequest.get({
    url: "get_patient",
    data:  {
      "loginkey":  wx.getStorageSync('loginkey'),
    }
  }, resolve)
}

/**
 * 提交手诊图
 * @param {*} formData 
 */
export function sub(resolve, formData) {
  lhRequest.post({
    url: "sub",
    data: formData
  }, resolve)
}

/**
 * 获取推理结果/历史记录详情
 * @param {*} loginkey 
 * @param {*} infer_user_id 
 */
export function getEasRun(resolve, reject, infer_user_id) {
  lhRequest.post({
    url: "get_eas_run",
    data: {
      "loginkey":  wx.getStorageSync('loginkey'),
      "infer_user_id": infer_user_id
    },
    lhRequest_options: {//请求配置
      isShowLoad: false,//是否显示加载中(true)
    }
  }, resolve, reject)
}

/**
 * 历史记录
 * @param {*} loginkey 
 */
export function history(resolve, page = 0) {
  lhRequest.get({
    url: "history",
    data: {
      "loginkey":  wx.getStorageSync('loginkey'),
      "page": page
    }
  }, resolve)
}

